package com.caxxb.dao.impl;

import com.caxxb.dao.GameTypeDao;
import com.caxxb.entity.GameType;
import com.caxxb.util.DBUtil;

import java.util.List;

public class GameTypeDaoImpl implements GameTypeDao {
    @Override
    public List<GameType> getTypes() {
        String sql="SELECT * from game_type";
        List list = DBUtil.exQuery(sql,GameType.class);
        return list;
    }

    @Override
    public String getTypeName(int id) {
        String sql="SELECT * from game_type where typeid=?";
        List list = DBUtil.exQuery(sql, GameType.class, id);
        GameType gameType = (GameType) list.get(0);
        String typename = gameType.getTypename();
        return typename;
    }
}
